include ../config.mak

DRIVERS=SCPI.o SCPIServer.o SCPIContext.o SCPISocket.o SCPIBind.o SCPIResolve.o \
        TimeTaggerSCPI.o TimeTaggerSystem.o TimeTaggerConfigure.o 

all: scpi.a _scpi.so

clean:
	rm -f scpi.a _scpi.so scpi.py scpi_wrap.cxx *.o
	make -C libscpi clean 

scpi.a: $(DRIVERS)
	ar r $@ $? 

%.o: %.cpp
	g++ -c $(CFLAGS)  $<


scpi_wrap.cxx: scpi.i SCPI.h 
	swig -classic -Wall -c++ -python scpi.i

scpi_wrap.o: scpi_wrap.cxx
	g++ -c $(CFLAGS) $<

_scpi.so: scpi_wrap.o scpi.a libscpi/libscpi.a
	g++ -shared $^ -o _scpi.so $(LFLAGS)

libscpi/libscpi.a: 
	make -C libscpi libscpi.a
	